package com.baichang.taoshunda.service.impl;

import com.baichang.taoshunda.dao.LinkUrlDao;
import com.baichang.taoshunda.service.LinkUrlService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class LinkUrlServiceImpl implements LinkUrlService {

    @Autowired
    private LinkUrlDao linkUrlDao;

    /**
     * 获取关于我们链接地址
     *
     * @return
     */
    @Override
    public Map<String, Object> getConstantsUsUrl() {
        return linkUrlDao.getEntityById(1).toMap();
    }

    /**
     * 获取联系客服链接地址
     *
     * @return
     */
    @Override
    public Map<String, Object> contactCustomer() {
        return linkUrlDao.getEntityById(2).toMap();
    }

    /**
     * 获取用户协议地址
     *
     * @return
     */
    @Override
    public Map<String, Object> businessAgreement() {
        return linkUrlDao.getEntityById(11).toMap();
    }

    /**
     * 获取用户的关于我们
     *
     * @param i
     * @return
     */
    @Override
    public Map<String, Object> getConstantsUsUrlById(int i) {
        return linkUrlDao.getEntityById(i).toMap();
    }

    @Override
    public Map<String, Object> getLinkUrlById(Integer id) {
        return linkUrlDao.getLinkUrlById(id);
    }
}
